<%--
  Created by IntelliJ IDEA.
  User: mjones
  Date: Apr 12, 2010
  Time: 10:25:03 PM
  To change this template use File | Settings | File Templates.
--%>

<%@ page contentType="text/html;charset=UTF-8" %>
<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  <meta name="layout" content="main"/>
  <g:javascript library="application"/>
  <modalbox:modalIncludes/>
  <g:set var="entityName" value="${message(code: 'activity.label', default: 'Selected Activities')}"/>
  <title><g:message code="default.list.label" args="[entityName]"/></title></head>
<body>
Total: ${activityAttemptInstanceTotal}
<div class="body">
  <h1><g:message code="default.list.label" args="[entityName]"/></h1>
  <g:if test="${flash.message}">
    <div class="message">${flash.message}</div>
  </g:if>
  <div class="list">
    <table>
      <thead>
      <tr>

        <%--<g:sortableColumn property="id" title="${message(code: 'activity.id.label', default: 'Id')}" />--%>

        <td><b>Title</b></td>
        <td><b>Description</b></td>
        <td><b>Kukui Nuts</b></td>
        <td><b>Event Date</b></td>

      </tr>
      </thead>
      <tbody>
      <g:each in="${activityAttemptInstanceList}" status="i" var="activityAttemptInstance">
        <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">

          <%--<td><g:link action="show" id="${activityInstance.id}">${fieldValue(bean: activityInstance, field: "id")}</g:link></td>--%>
         <g:if test="${activityAttemptInstance.activity.verificationType == 'Text_Field'}">
          <td><modalbox:createLink controller="myPage" action="activityTextEdit" id="${activityAttemptInstance.id}" title="Activity Details" width="500">${activityAttemptInstance?.activity}</modalbox:createLink></td>
         </g:if>
          <g:if test="${activityAttemptInstance.activity.verificationType == 'Upload_Image'}">
          <td><modalbox:createLink controller="myPage" action="activityImageEdit" id="${activityAttemptInstance.id}" title="Activity Details" width="500">${activityAttemptInstance?.activity}</modalbox:createLink></td>
         </g:if>
         <g:if test="${activityAttemptInstance.activity.verificationType == 'Confirmation_Code'}">
          <td><modalbox:createLink controller="myPage" action="activityCodeEdit" id="${activityAttemptInstance.id}" title="Activity Details" width="500">${activityAttemptInstance?.activity}</modalbox:createLink></td>
         </g:if>
         <%--<td><g:link action="show" id="${activityInstance.id}">${fieldValue(bean: activityInstance, field: "title")}</g:link></td>--%>
          <td>${activityAttemptInstance.activity.description}</td>
          <td>${activityAttemptInstance.activity.kukuiNuts}</td>
          <td><g:if test="${activityAttemptInstance.activity.activityType == 'Event'}">${activityAttemptInstance.activity.eventDate}</g:if></td>
          <%--<td>${fieldValue(bean: activityAttemptInstance, field: "description")}</td>--%>

          <%--<td>${factivityAttemptInstance?.activity.kukuiNuts}</td>--%>
          

        </tr>
      </g:each>
      </tbody>
    </table>
  </div>
  <%--<div class="paginateButtons">
    <g:paginate total="${activityInstanceTotal}"/>
  </div> --%>
</div>

</body>
</html>